import { S } from '../../s';
import { IPSAppView } from '../../app/view/ipsapp-view';
import { IPSNavigateContext } from '../ipsnavigate-context';
import { IPSNavigateParam } from '../ipsnavigate-param';
import { IPSDEForm } from './ipsdeform';
import { IPSDEFormDRUIPart } from './ipsdeform-druipart';
import { IPSDEFormItemUpdate } from './ipsdeform-item-update';
import { PSDEFormDetailImpl } from './psdeform-detail-impl';
import { IPSLanguageRes } from '../../res/ipslanguage-res';

export class PSDEFormDRUIPartImpl
  extends PSDEFormDetailImpl
  implements IPSDEFormDRUIPart
{
  get maskInfo(): string {
    return this.M.maskInfo;
  }

  get maskMode(): -1 | 0 | 1 {
    return this.M.maskMode != null ? this.M.maskMode : -1;
  }

  protected maskpslanguageres: IPSLanguageRes;
  getMaskPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.maskpslanguageres ||
      (this.maskpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getMaskPSLanguageRes,
        S._3f9,
      ) as IPSLanguageRes)
    );
  }

  protected psappview: IPSAppView;
  getPSAppView(): IPSAppView | null {
    return (
      this.psappview ||
      (this.psappview = this.fillObjectModel(
        S._1e,
        this.M.getPSAppView,
        S._2c4,
      ) as IPSAppView)
    );
  }

  protected psdeformitemupdate: IPSDEFormItemUpdate;
  getPSDEFormItemUpdate(): IPSDEFormItemUpdate | null {
    if (this.psdeformitemupdate != null) return this.psdeformitemupdate;
    const value = this.M.getPSDEFormItemUpdate;
    if (value == null) {
      return;
    }
    const ipsdeform = this.getParentPSModelObject(S._23d) as IPSDEForm;
    if (ipsdeform != null) {
      this.psdeformitemupdate = ipsdeform.findPSDEFormItemUpdate(value);
    }
    return this.psdeformitemupdate;
  }

  protected psnavigatecontexts: IPSNavigateContext[];
  getPSNavigateContexts(): IPSNavigateContext[] | null {
    return (
      this.psnavigatecontexts ||
      (this.psnavigatecontexts = this.fillChildListModel(
        this.M.getPSNavigateContexts,
        S._8c,
      ) as IPSNavigateContext[])
    );
  }

  findPSNavigateContext(objKey: any): IPSNavigateContext | null {
    return this.getPSModel5(
      S._8c,
      this.getPSNavigateContexts(),
      objKey,
    ) as IPSNavigateContext;
  }

  protected psnavigateparams: IPSNavigateParam[];
  getPSNavigateParams(): IPSNavigateParam[] | null {
    return (
      this.psnavigateparams ||
      (this.psnavigateparams = this.fillChildListModel(
        this.M.getPSNavigateParams,
        S._8a,
      ) as IPSNavigateParam[])
    );
  }

  findPSNavigateParam(objKey: any): IPSNavigateParam | null {
    return this.getPSModel5(
      S._8a,
      this.getPSNavigateParams(),
      objKey,
    ) as IPSNavigateParam;
  }

  get paramItem(): string {
    return this.M.paramItem;
  }

  get parentDataJO(): IModel {
    return this.M.parentDataJO;
  }

  get refreshItems(): string {
    return this.M.refreshItems;
  }

  get needSave(): boolean {
    return this.M.needSave;
  }

  get refreshItemsSetParamOnly(): boolean {
    return this.M.refreshItemsSetParamOnly;
  }
  get cls(): string {
    return 'PSDEFormDRUIPartImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._7 || cls == S._b1) return true;
    return super.instanceof(cls);
  }
}
